<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">

    <title>CT-ThuChi</title>
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/styles/dm.css">
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />
    <link rel="stylesheet" type="text/css" class="init">


	<!-- Base Jquery -->
	{*
	{if $allowCDN}<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">{literal}
		// Provide a local fallback if the CDN cannot be reached
		if (typeof google == 'undefined') {
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js' type='text/javascript'%3E%3C/script%3E"));
		} else {
			google.load("jquery", "{/literal}{$smarty.const.CDN_JQUERY_VERSION}{literal}");
			google.load("jqueryui", "{/literal}{$smarty.const.CDN_JQUERY_UI_VERSION}{literal}");
		}
	{/literal}</script>
	{else}
	*}

	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/ShowHintMATK.js?V1"></script>
	{*{/if}
	*}


</head>


{strip}
{assign var="pageTitle" value="Chung tu"}
{if ($loaitien) != 'VND' }
	{assign var="socot" value="6"}
{else}
	{assign var="socot" value="5"}
{/if}

<body class="dt-example" style="font-size:12px">

{include file="acct/acctNavbar.tpl"}

{/strip}

<form method="post" action="{url Nam= $xNam ChiTiet = $ChiTiet mant = $loaitien} ">

<table width = "60%" align = "center" >
<tr><td><div class="DMtitle" style = "valign: center; text-align: center; text-transform: uppercase ">{$loaiphieu} ({$loaitien})</div></td></tr>
<tr rowspan = "2">
<td width = "70%" align = "center" >
	<hr size="2" noshade style="color:#000000"  />

	T&#7915; ngày: 
	{html_select_date prefix="dateExpire1" all_extra="class=\"selectMenu\""  day_extra= 1 start_year="-5" end_year="+5" time="$Date1"}
	<br>

	&#272;&#7871;n ngày: 
	{html_select_date prefix="dateExpire2" all_extra="class=\"selectMenu\""  day_extra= 1 start_year="-5" end_year="+5" time="$Date2"}
	<hr style="height:5px; visibility:hidden;" />
	<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>

	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>


	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;
	<hr size="2" noshade style="color:#000000"  />
		
</td>

<td width = "30%" align = "center">
	<input type="submit" value="Tìm/Xem" class="button" />
	<input id="cancel" type="button" onclick="document.location.href='{url  op='CN_TMTG' ChiTiet=$mact Nam=$xNam escape=false}'" value="Trở về " class="button" /><br>
	<input type="button" value="Thêm chứng từ mới" class="button" onclick="document.location.href='{url page= "acctCN" op='CTTMTG' mant=$loaitien ChiTiet=$mact Mode = 'add' Nam=$xNam escape=false}'" /> 
	
</td>
</tr>

<tr>

</tr>
</table>

<br>


<br>
<table width = "90%" align = "center" >
{if $ctkts->wasEmpty()}
	<tr>
		<td class="nodata">Không có dữ liệu</td>
	</tr>
	<tr>
		<td colspan="{$socot}" class="endseparator">&nbsp;</td>
	</tr>

{else}
	<tr>
		<td colspan="3" align="left">{page_info iterator=$ctkts}
		&nbsp  &nbsp &nbsp &nbsp
		{page_links anchor="ctkts" name="ctkts" iterator=$ctkts searchField=$searchField searchMatch=$searchMatch search=$search ngay1 = $Date1 ngay2 = $Date2 ChiTiet=$mact mant =$loaitien }</td>
		<td>
		</td>

	</tr>
{/if}
</table>


</form>
<div id="sections">

<table id="customers"  width="90%" align = "center" cellspacing="0" >
        {if ($loaitien eq "VND")}
		<tr>
		    <th>Ngày</th>
		    <th>Số CT</th>
		    <th>Diễn giải</th>
		    <th class="soquy">TK</th>
		    <th>TK ĐU</th>
		    <th>Chi tiết</th>
		    <th id="sotien">Phát sinh</th>
		    <th>Tác vụ</th>
		</tr>

	    {assign var = "tpl_idphieu1" value = "0"}
	    {iterate from=ctkts item=ctkt name=ctkts}
		{assign var = "tpl_idphieu2" value = $ctkt->getidphieu()}

                <tr>
			{if $tpl_idphieu1 != $tpl_idphieu2}
			    <td >
				{$ctkt->getngct()|date_format:"%d/%m/%Y"|escape}
			    </td>
			    <td>
			       {$ctkt->getsoct()|escape}
			    </td>
			 {else}
				<td colspan = 2></td>
			 {/if}

                    <td id="noidung">{$ctkt->getdiengiai()}</td>
                    <td id="tk">{$ctkt->gettk()}</td>
                    <td id="tkdu">{$ctkt->gettkdu()}</td>
		    <td id="macttk">{$ctkt->getmacttkdu()}</td>
		    <td style="text-align:right" id="sotien">
			 {$ctkt->getsotienvn()|number_format:0:".":"."}
		    </td>
		    <td >
			{if $tpl_idphieu1 != $tpl_idphieu2}
			{assign var = "tpl_idphieu1" value = $tpl_idphieu2}
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="PrintCT('{$ctkt->getidphieu()}', '{$xNam}', '{$noco}','{$urlIn}');">In </a>  &nbsp &nbsp
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="editCT('{$ctkt->getidphieu()}', '{$url}');">S&#7917;a </a>  &nbsp &nbsp
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="deleCT('{$host}', '{$username}', '{$password}', '{$databaseName}', '{$journalid}','{$xNam}', '{$ctkt->getidphieu()}', '{$ctkt->getsoct()}', '{$urlDel}', '{$urlRFR}');">X&#243;a </a>  


			{/if}
		    </td>

            {/iterate}


	{else}
		<tr>
		    <th>Ngày</th>
		    <th>Số CT</th>
		    <th>Diễn giải</th>
		    <th class="soquy">TK</th>
		    <th>TK ĐU</th>
		    <th>Chi tiết</th>
		    <th id="sotien">{$loaitien}</th>
		    <th id="sotien">VNĐ</th>

		    <th>Tac vu</th>
		</tr>
	    {assign var = "tpl_idphieu1" value = "0"}
	    {iterate from=ctkts item=ctkt name=ctkts}
		{assign var = "tpl_idphieu2" value = $ctkt->getidphieu()}

                <tr>
			{if $tpl_idphieu1 != $tpl_idphieu2}
			    <td >
				{$ctkt->getngct()|date_format:"%d/%m/%Y"|escape}
			    </td>
			    <td>
			       {$ctkt->getsoct()|escape}
			    </td>
			 {else}
				<td colspan = 2></td>
			 {/if}

                    <td id="noidung">{$ctkt->getdiengiai()}</td>
                    <td id="tk">{$ctkt->gettk()}</td>
                    <td id="tkdu">{$ctkt->gettkdu()}</td>
		    <td id="macttk">{$ctkt->getmacttkdu()}</td>
		    <td style="text-align:right" id="sotien">
			 {$ctkt->getsotiennt()|number_format:2:",":"."}
		    </td>

		    <td style="text-align:right" id="sotien">
			 {$ctkt->getsotienvn()|number_format:0:".":"."}
		    </td>
		    <td >
			{if $tpl_idphieu1 != $tpl_idphieu2}
			{assign var = "tpl_idphieu1" value = $tpl_idphieu2}
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="PrintCT('{$ctkt->getidphieu()}', '{$xNam}', '{$noco}','{$urlIn}');">In </a>  &nbsp &nbsp
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="editCT('{$ctkt->getidphieu()}', '{$url}');">S&#7917;a </a>  &nbsp &nbsp
			<a  id = '{$ctkt->getidphieu()}' class="actiondelrow" href="javascript:void(0);" onclick="deleCT('{$host}', '{$username}', '{$password}', '{$databaseName}', '{$journalid}','{$xNam}', '{$ctkt->getidphieu()}', '{$ctkt->getsoct()}', '{$urlDel}', '{$urlRFR}');">X&#243;a </a>  


			{/if}
		    </td>

            {/iterate}



	{/if}

</table>

</div>
{include file="common/footer.tpl"}

</body>
</html>

	
